package com.gurun.camera.account.utils;

import java.util.regex.Pattern;

public class PatternMatchUtil {

	/**
	 * 匹配Email地址
	 * @param email
	 * @return
	 */
	public static boolean isEmailAddress(String email) {
		final String expression = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
		return Pattern.matches(expression, email);
	}

	/**
	 * 
	 * @param number
	 * @return
	 */
	public static boolean isNumber(String number) {
		final String expression = "^[0-9]*$";
		return Pattern.matches(expression, number);
	}

}
